<div id="pagenavi" class="noselect">
    {% if article_list.has_previous %}
        <a class="previous-page" href="?page={{ article_list.previous_page_number }}">
            <span class="icon-previous"></span>上一页
        </a>
    {% endif %}

    {% if first_page == current_page %}
        <span class="first-page current">1</span>
    {% else %}
        <a href="?page=1" class="first-page">1</a>
    {% endif %}

    {% if pages_first > 2 %}
        <span>...</span>
    {% endif %}

    {% for page in pages %}
        {% if page == current_page %}
            <span class="current">{{ page }}</span>
        {% else %}
            <a href="?page={{ page }}">{{ page }}</a>
        {% endif %}
    {% endfor %}

    {% if pages_last < last_page %}
        <span>...</span>
    {% endif %}

    {% if last_page != 1 %}
        {% if last_page == current_page %}
            <span class="current">{{ last_page }}</span>
        {% else %}
            <a href="?page={{ last_page }}">{{ last_page }}</a>
        {% endif %}
    {% endif %}

    {% if article_list.has_next %}
        <a class="next-page" href="?page={{ article_list.next_page_number }}">
            下一页<span class="icon-next"></span>
        </a>
    {% endif %}
</div>